<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:fn="http://java.sun.com/jsp/jstl/functions"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<f:loadBundle basename="MessageResources" var="messages" />

<ui:composition>
	<h:form id="smtaReportHomeTableForm">
		<p:dataTable id="smtaReportHomeTable" var="smtaReportHome"
			value="#{smtaReportHomeBean.allSmtaReports}"
			rowKey="#{smtaReportHome.id}"
			selection="#{smtaReportHomeBean.selectedSmtaReport}" paginator="true"
			paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
			currentPageReportTemplate="#{messages.PAGE_LABEL}" rows="15"
			rowsPerPageTemplate="5,10,15,20,30,50,100" selectionMode="single"
			lazy="true" editable="false">

			<p:ajax event="rowSelect"
				listener="#{smtaReportHomeBean.onRowSelect}" />
			<p:ajax event="rowUnselect"
				listener="#{smtaReportHomeBean.onRowUnselect}" />

			<f:facet name="header">
				<p:commandButton id="topSetAsUnreportedCommand" value="Set selected SMTA as Unreported"
					icon="ui-icon-radio-off"
					update=":smtaReportHomeTableForm:smtaReportHomeTable"
					actionListener="#{smtaReportHomeBean.setAsUnreported}" style="float: left" />
				<p:tooltip for="topSetAsUnreportedCommand" value="Set selected SMTA as Unreported"
					showEffect="#{uiConfigBean.tooltipShowEffect}"
					hideEffect="#{uiConfigBean.tooltipHideEffect}" />
					
				<p:commandButton id="topSetAsReportedCommand" value="Set selected SMTA as Reported"
					icon="ui-icon-check"
					update=":smtaReportHomeTableForm:smtaReportHomeTable"
					actionListener="#{smtaReportHomeBean.setAsReported}" style="float: left" />
				<p:tooltip for="topSetAsReportedCommand" value="Set selected SMTA as Reported"
					showEffect="#{uiConfigBean.tooltipShowEffect}"
					hideEffect="#{uiConfigBean.tooltipHideEffect}" />

				<h:outputText value="SMTA Reports" style="float: center" />
			</f:facet>

			<p:column id="symbolColumn" headerText="Symbol"
				filterBy="#{smtaReportHome.symbol}" filterMatchMode="contains">
				<h:outputText value="#{smtaReportHome.symbol}" />
			</p:column>

			<p:column id="reportedToTreatyColumn" headerText="Reported To Treaty?"
				filterBy="#{smtaReportHome.reportedToTreaty}"
				filterOptions="#{smtaReportHomeBean.yesNoOptions}" 
				filterMatchMode="exact">
				<h:selectBooleanCheckbox value="#{smtaReportHome.reportedToTreaty}"
					disabled="true" />
			</p:column>

			<p:column id="reportedDateColumn" headerText="Reported Date">
				<h:outputText value="#{smtaReportHome.reportedDate}">
					<f:convertDateTime dateStyle="medium" type="both" />
				</h:outputText>
			</p:column>
			
			<p:column id="sendAttemptsColumn" headerText="Report Attempts">
				<h:outputText value="#{smtaReportHome.reportAttempts}" />
			</p:column>

			<p:column id="dateColumn" headerText="Date">
				<h:outputText value="#{smtaReportHome.smtaDate}" />
			</p:column>

			<p:column id="smtaTypeColumn" headerText="Type">
				<h:outputText value="#{smtaReportHome.smtaType}" />
			</p:column>

			<p:column id="languageColumn" headerText="Language">
				<h:outputText value="#{smtaReportHome.language}" />
			</p:column>

			<p:column id="providerTypeColumn" headerText="Provider Type">
				<h:outputText value="#{smtaReportHome.providerType}" />
			</p:column>

			<p:column id="providerPidColumn" headerText="Provider PID">
				<h:outputText value="#{smtaReportHome.providerPid}" />
			</p:column>

			<p:column id="providerNameColumn" headerText="Provider Name">
				<h:outputText value="#{smtaReportHome.providerName}" />
			</p:column>

			<p:column id="providerAddressColumn" headerText="Provider Address">
				<h:outputText value="#{smtaReportHome.providerAddress}" />
			</p:column>

			<p:column id="providerCountryColumn" headerText="Provider Country">
				<h:outputText value="#{smtaReportHome.providerCountry}" />
			</p:column>

			<p:column id="providerEmailColumn" headerText="Provider Email">
				<h:outputText value="#{smtaReportHome.providerEmail}" />
			</p:column>

			<p:column id="recipientTypeColumn" headerText="Recipient Type">
				<h:outputText value="#{smtaReportHome.recipientType}" />
			</p:column>

			<p:column id="recipientPidColumn" headerText="Recipient PID">
				<h:outputText value="#{smtaReportHome.recipientPid}" />
			</p:column>

			<p:column id="recipientNameColumn" headerText="Recipient Name">
				<h:outputText value="#{smtaReportHome.recipientName}" />
			</p:column>

			<p:column id="recipientAddressColumn" headerText="Recipient Address">
				<h:outputText value="#{smtaReportHome.recipientAddress}" />
			</p:column>

			<p:column id="recipientCountryColumn" headerText="Recipient Country">
				<h:outputText value="#{smtaReportHome.recipientCountry}" />
			</p:column>

			<p:column id="shipmentNameColumn" headerText="Shipment Name">
				<h:outputText value="#{smtaReportHome.shipmentName}" />
			</p:column>

			<p:column id="documentLocationColumn" headerText="Document Location">
				<h:outputText value="#{smtaReportHome.documentLocation}" />
			</p:column>

			<p:column id="documentRetrievalInfoColumn"
				headerText="Document Retrieval Info">
				<h:outputText value="#{smtaReportHome.documentRetrievalInfo}" />
			</p:column>

			<p:column id="pdfUrlColumn" headerText="PDF URL">
				<h:outputText value="#{smtaReportHome.pdfUrl}" />
			</p:column>
		</p:dataTable>

	</h:form>
</ui:composition>

</html>
